<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->string('email')->unique();
            $table->string('password', 60);
            $table->mediumInteger('honor_point');
            $table->char('nick_name',20);
            $table->char('slogan',40);
            $table->string('avatar_image');
            $table->rememberToken();
            $table->timestamps();

            $table->integer('github_id');
            $table->string('github_token');
            $table->string('github_name');
            $table->string('github_nickname');
            $table->string('github_email');
            $table->string('github_avatar');
            $table->text('github_json');

            $table->integer('weibo_id');
            $table->string('weibo_token');
            $table->string('weibo_name');
            $table->string('weibo_nickname');
            $table->string('weibo_email');
            $table->string('weibo_avatar');
            $table->text('weibo_json');

            $table->integer('qq_id');
            $table->string('qq_token');
            $table->string('qq_name');
            $table->string('qq_nickname');
            $table->string('qq_email');
            $table->string('qq_avatar');
            $table->text('qq_json');

            $table->integer('weixin_id');
            $table->string('weixin_token');
            $table->string('weixin_name');
            $table->string('weixin_nickname');
            $table->string('weixin_email');
            $table->string('weixin_avatar');
            $table->text('weixin_json');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('users');
    }
}
